package com.steven.springcloud2productservice.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashSet;
import java.util.Set;

/**
 * @author CXQ
 * @version 1.0
 */
@RestController
@RequestMapping("/api/v1/product")
public class ProductController {

    @RequestMapping("select-all")
    public Set<String> selectAll() {
        Set<String> result = new HashSet<>();
        result.add("手机");
        result.add("电脑");
        return result;
    }

    @RequestMapping("select-by-id")
    public String selectById(int id) {
        return id == 1 ? "001-手机" : "002-电脑";
    }

}
